package Constructors;

public class MyClass {
    int x;
    public MyClass(int y){
        System.out.println("构造MyCLass");
        x=y;
    }
    public static void main(String[] args){
        MyClass myObj = new MyClass(5);
        System.out.println(myObj.x);
    }
}
//输出
//构造MyClass
//5